package ControlLayer;
import ModelLayer.*;
import java.util.*;

/**
 * 
 * 
 * @author (Brian, Jesper, Jesper og  Hoang) 
 * @version ()
 */
public class OrderCtr
{
    //Instance variabler
    private KundeCtr kundeCtr;
    private LagerCtr lagerCtr;
    private OrderContainer orderContainer;

    //Constructor
    public OrderCtr()
    {
        kundeCtr = new KundeCtr();
        lagerCtr = new LagerCtr();
        orderContainer = orderContainer.getOrderContainer();
    }

    //Metode til at oprette en order
    public void createOrder(int _id, int _kundeId, int _vareId, int _antal, String _status)
    {
        KundeGruppe _kunde = kundeCtr.findKundeGruppe(_kundeId);
        
        Vare _vare = lagerCtr.findVare(_vareId);
        
        if(_kunde != null && _vare != null)
        {
            DelOrdre newOrder = new DelOrdre(_id, _kunde, _vare, _antal, _status);

            orderContainer.addOrdre(newOrder);    
        }
    }
}
